package cn.slipi.admin.common.utils.validation.constrations;

import cn.slipi.admin.common.utils.validation.EnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 判断入参是否在枚举内
 *
 * @author lee
 * @date 2019/1/22
 * @since 1.0.0
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
@Constraint(validatedBy = EnumValidator.class)
public @interface InEnum {
    Class<?> value();

    String message() default "参数不在要求范围内";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}